import org.openjdk.jol.info.ClassLayout;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @author fangkun
 * @create 2022-12-14-14:11
 */
public class MyObject {

    private static Object objectLock = new Object();

    public static void main(String[] args) {
        new Thread(() -> {
            synchronized (objectLock){
                System.out.println(ClassLayout.parseInstance(objectLock).toPrintable());
            }
        },"t1").start();


        new Thread(() -> {
            synchronized (objectLock){
                System.out.println(ClassLayout.parseInstance(objectLock).toPrintable());
            }
        },"t2").start();


        ReentrantLock lock = new ReentrantLock();

        lock.lock();


        lock.unlock();
    }
}


